import service from "@/utils/request";
import type { Response, PageResponse, CodeName } from "@/types/common";

// <any, Response<PageResponse<DevPageItem>>>
// <any, Response<DevPageItem>>
export const useAttendTeamPageApi = (params: object) => {
  return service({
    url: `/v1/attend/team/page`,
    method: "GET",
    params,
  });
};

export const useAttendTeamListApi = (params: object) => {
  return service({
    url: `/v1/attend/team/list`,
    method: "GET",
    params,
  });
};

export const useAttendTeamQueryApi = (params: object) => {
  return service({
    url: `/v1/attend/team/query`,
    method: "GET",
    params,
  });
};

export const useAttendTeamCreateApi = (data: object) => {
  return service({
    url: `/v1/attend/team/create`,
    method: "POST",
    data,
  });
};

export const useAttendTeamUpdateApi = (data: object) => {
  return service({
    url: `/v1/attend/team/update`,
    method: "POST",
    data,
  });
};

export const useAttendTeamDeleteApi = (data: object) => {
  return service({
    url: `/v1/attend/team/delete`,
    method: "DELETE",
    data,
  });
};

// 人员绑定
export const useAttendTeamEmployeePageApi = (params: object) => {
  return service<any, Response<PageResponse<CodeName>>>({
    url: `/v1/attend/teamEmployee/page`,
    method: "GET",
    params,
  });
};

export const useAttendTeamEmployeeCreateApi = (data: object) => {
  return service({
    url: `/v1/attend/teamEmployee/create`,
    method: "POST",
    data,
  });
};

export const useAttendTeamEmployeeDeleteApi = (data: object) => {
  return service({
    url: `/v1/attend/teamEmployee/delete`,
    method: "DELETE",
    data,
  });
};
